#include "common/texture_indexs.h"

#include <QMap>
#include <QVector>

static QMap<QString, int> tex_index;
static QVector<unsigned int> tex_names;

unsigned int get_texture_name(int index)
{
    return tex_names.at(index);
}

unsigned int get_texture_name(const QString &colour)
{
    int index = tex_index[colour];
    return get_texture_name(index);
}

void add_texture(const QString &key, int value)
{
    tex_index.insert(key, value);
    tex_names.resize(tex_names.size() + 1);
}

void add_texture_name(int index, unsigned int name)
{
    tex_names[index] = name;
}
